
/** 创建提示框 */
var zIndex = 999990;
var js_remind = function(options){
	options = jQuery.extend({
		appendDiv: document.body,
		success: null,
		message:""
	}, options);
	
	//得到相关参数，如控件ID、显示信息、成功事件、显示title等等
	var eleId = options.id == null ? "swin_dialog" : options.id;
	var message = options.message;
	var successCallBack = (options.success != null && typeof(options.success) == "function") ? options.success : null;
	var k = 0;
	while(document.getElementById('swin_div_'+eleId+"_"+k)){
		k++;
	}
	var seinId = eleId+"_"+k
	var title = options.title == null ? "" : options.title;
	
	//得到剧中的数量
	var w = $(window).width();
	var h = $(window).height();
	var width = options.width == null ? (w-30) : options.width;
	var height = options.height == null ? (h-30) : options.height;
	var leftNum = parseInt(width,10)/2;
	var topNum = parseInt(height,10)/2;
	
	$(options.appendDiv).append($('<div id="shield_div_iframe_'+seinId+'" class="shield_base_div" style="z-index:'+(zIndex)+'; width: '+w+'px; height: '+h+'px;"><iframe frameborder="0" scrolling="no"></iframe></div>'));
	
	//创建显示层的控件
	var $_swin = $("<DIV>",{
		id:'swin_div_'+seinId,
		width:width+"px",
		height:height+"px"
	}).addClass("open_dialog_div").css({"margin-left":"-"+leftNum+"px","margin-top":"-"+topNum+"px", 'z-index':(zIndex+k+1)});
	zIndex = zIndex + k + 1;
	
	//存放内容的空间
	var html = new Array();
	html.push('<div class="top_head">');
//	html.push('<div id="swin_div_');
//	html.push(seinId);
//	html.push('_titleimg" class="title_img"></div>');
	html.push('<div id="swin_div_');
	html.push(seinId);
	html.push('_title" class="title">');
	html.push('</div>');
	html.push('</div>');
	html.push('<div id="swin_div_');
	html.push(seinId);
	html.push('_content" class="content_div">');
	html.push('</div>');
	html.push('</div>');
	$_swin.append($(html.join('')));
	 
	//放到body中
	$(options.appendDiv).append($_swin);
	
	//设置内容信息框高度
	var contentHeight = height-50;
	$("#swin_div_"+seinId+"_content").css("height", contentHeight+"px");
	
	//给弹出框加图标
	//$("#swin_div_"+seinId+"_titleimg").css({"background":"url(common/css/dialog/messages.png)"});
	
	//不回提示内容
	var html = new Array();
	html.push('<div style="height:'+(contentHeight-100)+'px;"><p class="ts_info_text">'+message+'</p></div>');
	//html.push('<div style="height:30px; margin-top:10px;">');
    //成功提示信息显示样式
	if (eleId == "showSuccess"){
		$("#swin_div_"+seinId+"_title").html('成功提示信息');
		html.push('<ul class="txt_btn"><li><div id="swin_div_'+seinId+'_commit" class="btn bgColorII font">确定</div></li></ul>');
		
    //失败提示信息显示样式
	} else if (eleId == "showError"){
		$("#swin_div_"+seinId+"_title").html('失败提示信息');
		html.push('<ul class="txt_btn"><li><div id="swin_div_'+seinId+'_commit" class="btn bgColorII font">确定</div></li></ul>');
		
    //确认提示信息显示样式
	} else if (eleId == "showConfirm"){
		$("#swin_div_"+seinId+"_title").html(title);
		html.push('<ul class="txt_btn"><li><div id="swin_div_'+seinId+'_commit" class="btn bgColorII font">确定</div></li>');
		html.push('<li><div id="swin_div_'+seinId+'_cancel" class="btn bgColor font">取消</div></li></ul>');
		
	}
	//html.push('</div>');
	$("#swin_div_"+seinId+"_content").append($(html.join('')));
	
	//添加确认按钮事件
	if(document.getElementById("swin_div_"+seinId+"_commit")){
		$("#swin_div_"+seinId+"_commit").click(function(){
			$(this).remove();
			$("#shield_div_iframe_"+seinId).remove();
			$_swin.remove();
			if(successCallBack != null){
				successCallBack(swinReturnValue);
			}
			swinReturnValue = null;
			return;
		})
	}
	
	//添加取消按钮事件
	if(document.getElementById("swin_div_"+seinId+"_cancel")){
		$("#swin_div_"+seinId+"_cancel").click(function(){
			$(this).remove();
			$("#shield_div_iframe_"+seinId).remove();
			$_swin.remove();
			return;
		})
	}
	
	//显示
	$_swin.show();
	
}
